<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red {
            color: red;
        }

        .fontSize {
            font-size: 20px;
        }

        .dd {
            background-color: lightgreen;
        }
    </style>
</head>

<body>
    <div id="app">
        <div :style='styleObj'>this is a div tag</div>
        <div :style='styleArr'>this is a div tag</div>
    </div>

    <script src='./js/vue.js'></script>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                styleObj: {
                    backgroundColor: "red"
                },
                // 数组写法
                styleArr: [
                    {
                        border: '2px solid #222'
                    },
                    {
                        backgroundColor: 'pink'
                    }
                ]
            },

        })
        // 修改添加样式
        vm.styleObj.backgroundColor = "green"
        vm.styleObj.fontSize = "50px"
        Vue.set(vm.styleObj, 'backgroundColor', 'orange')
    </script>
</body>

</html>